GAppInfo *info,
GList *files)
{
- return NULL;
+ GdkWaylandDisplay *display;
+ gchar *id = NULL;
+
+ g_object_get (context, "display", &display, NULL);
+
+ if (display->gtk_shell_version >= 3)
+ {
+ id = g_uuid_string_random ();
+ gtk_shell1_notify_launch (display->gtk_shell, id);
+ }
+
+ g_object_unref (display);
+
+ return id;
}
static void
#define MIN_SYSTEM_BELL_DELAY_MS 20
-#define GTK_SHELL1_VERSION 2
+#define GTK_SHELL1_VERSION 3
#define OUTPUT_VERSION_WITH_DONE 2
#define NO_XDG_OUTPUT_DONE_SINCE_VERSION 3
if (!impl->display_server.gtk_surface)
return;
- /* We didn't have an event to fetch a time from, meaning we have nothing valid
- * to send. This should rather be translated to a 'needs-attention' request or
- * something.
- */
if (timestamp == GDK_CURRENT_TIME)
- return;
+ {
+ GdkWaylandDisplay *display_wayland =
+ GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
- gtk_surface1_present (impl->display_server.gtk_surface, timestamp);
+ if (display_wayland->gtk_shell_version >= 3)
+ {
+ gtk_surface1_request_focus (impl->display_server.gtk_surface,
+ display_wayland->startup_notification_id);
+ g_clear_pointer (&display_wayland->startup_notification_id, g_free);
+ }
+ }
+ else
+ gtk_surface1_present (impl->display_server.gtk_surface, timestamp);
}
static void
<protocol name="gtk">
- <interface name="gtk_shell1" version="2">
+ <interface name="gtk_shell1" version="3">
<description summary="gtk specific extensions">
gtk_shell is a protocol extension providing additional features for
clients implementing it.
<request name="system_bell">
<arg name="surface" type="object" interface="gtk_surface1" allow-null="true"/>
</request>
+
+ <!-- Version 3 additions -->
+ <request name="notify_launch" since="3">
+ <arg name="startup_id" type="string"/>
+ </request>
</interface>
- <interface name="gtk_surface1" version="2">
+ <interface name="gtk_surface1" version="3">
<request name="set_dbus_properties">
<arg name="application_id" type="string" allow-null="true"/>
<arg name="app_menu_path" type="string" allow-null="true"/>
<event name="configure_edges" since="2">
<arg name="constraints" type="array"/>
</event>
+
+ <!-- Version 3 additions -->
+ <request name="request_focus" since="3">
+ <arg name="startup_id" type="string" allow-null="true"/>
+ </request>
</interface>
</protocol>